#include<bits/stdc++.h>
using namespace std;
const int N=4e5+5;
int n,m,k,fa[N],vis[N],u[N],v[N],cnt,tlh[N],fath[N];
vector<int> e[N],res[N];
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
struct node{
	int u,v,lca;
}b[N];
int dfs(int x,int f){
	tlh[x]=1;fath[x]=f;
	int h,fh=0;
	if(vis[x]) fh=x;
	for(auto v:e[x]){
		if(v==f) continue;
		h=dfs(v,x);
		if(h){
			if(fh){
				b[++cnt]={fh,h,x};
				fh=0;
			}
			else fh=h;
		}
	}
	return fh;
}
/*
8 7 4
1 2
2 3
3 4
2 5
5 6
3 7
7 8
1 4 6 8
checker travel12.in travel.out travel12.ans
*/
signed main() {
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>k;
	for(int i=1;i<=n;i++) fa[i]=i;
	for(int i=1;i<=m;i++) cin>>u[i]>>v[i];
	while(k--){
		int x;cin>>x;
		vis[x]=1;
	}
	for(int i=1;i<=m;i++){
		int uu=find(u[i]),vv=find(v[i]);
		if(uu==vv) continue;
		fa[uu]=vv;
		e[u[i]].push_back(v[i]);
		e[v[i]].push_back(u[i]);
	}
	for(int i=1;i<=n;i++){
		if(!tlh[i]) dfs(i,0);
	}
	cout<<cnt<<'\n';
	for(int i=1;i<=cnt;i++){
		int x=b[i].u,lca=b[i].lca;
		while(1){
			res[i].push_back(x);
			if(x==lca) break;
			x=fath[x];
		}
		x=b[i].v;stack<int> stk;while(!stk.empty())stk.pop();
		while(1){
			if(x==lca) break;
			stk.push(x);
			x=fath[x];
		}
		while(!stk.empty()){
			res[i].push_back(stk.top());
			stk.pop();
		}
	}
	for(int i=1;i<=cnt;i++){
		cout<<res[i].size()<<' ';
		for(auto v:res[i]) cout<<v<<' ';
		cout<<'\n';
	}
	return 0;
}
